import java.util.InputMismatchException;
import java.util.Scanner;

public class NeighbouringNumbers {
    public static void main(String args[]) {
        int[] inputArray;
        int minDistance;
        int indexOfClosestPair;

        try {
            inputArray = provideArrayInput();
            minDistance = Math.abs(inputArray[1] - inputArray[0]);
            indexOfClosestPair = 0;

            for (int i = 1; i < inputArray.length - 1; i++) {
                int distanceBetweenCurrentPair = Math.abs(inputArray[i + 1] - inputArray[i]);

                if (distanceBetweenCurrentPair < minDistance) {
                    minDistance = distanceBetweenCurrentPair;
                    indexOfClosestPair = i;
                }
            }
            System.out.println(indexOfClosestPair);
        } catch (InputMismatchException e) {
            System.err.println("Your numbers must be integers");
        }

    }

    private static int[] provideArrayInput() throws InputMismatchException {
        Scanner in = new Scanner(System.in);
        int arrayLength = 0;
        int[] result;

        System.out.println("Enter your array length:");
        arrayLength = in.nextInt();
        result = new int[arrayLength];

        System.out.println("Enter your array:");
        for (int i = 0; i < arrayLength; i++) {
            result[i] = in.nextInt();
        }
        in.close();
        return result;
    }
}
